﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="InstructorAnnouncementsMainScreen.aspx.cs" Inherits="METU_CMT.InstructorAnnouncementsMainScreen" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Table ID="Table1" runat="server" Width="80%" HorizontalAlign="Center" CssClass="chp-grid" style="font-size: 15px; margin-left: 50px; margin-top:50px;">
        <asp:TableRow ID="TableRow1" runat="server" Width="100%" HorizontalAlign="Left" >
             
            <asp:TableCell ID="TableCell2" runat="server" HorizontalAlign="Left">
                <asp:GridView ID="dtgAnnouncements" runat="server" Width="100%" ShowHeaderWhenEmpty="true" AutoGenerateColumns="false"
                    OnRowCancelingEdit="OnDtgAnnouncementCancellingEdit" OnRowEditing="OnDtgAnnouncementsRowEditing"
                    OnRowCommand="OnDtgAnnouncementsRowCommand" OnRowUpdating="OnDtgAnnouncementsRowUpdating"
                    ShowFooter="True" OnRowDeleting="OnDtgAnnouncementsRowDeleting" CssClass="chp-grid">
                    <columns>
                        <asp:TemplateField HeaderText="Subject">
                            <ItemTemplate>
                                <asp:Label ID="lblSubject" Text='<%# Bind("Subject") %>' runat="server"></asp:Label>
                                <asp:HiddenField ID="hfId" Value='<%# Bind("AnnouncementId") %>' runat="server">
                                </asp:HiddenField>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtSubjectEdit" Text='<%# Bind("Subject") %>' runat="server" TextMode="MultiLine" CssClass="chp-text-field"></asp:TextBox>
                                <asp:HiddenField ID="hfId" Value='<%# Bind("AnnouncementId") %>' runat="server">
                                </asp:HiddenField>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Entry">
                            <ItemTemplate>
                                <asp:Label ID="lblEntry" Text='<%# Bind("Entry") %>' runat="server"></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtEntryEdit" Text='<%# Bind("Entry") %>' runat="server" TextMode="MultiLine" CssClass="chp-text-field"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Action">
                            <ItemTemplate>
                                <asp:LinkButton runat="server" ID="lnkBtnDelete" Text="Delete" CommandName="Delete"></asp:LinkButton>
                                <asp:LinkButton runat="server" ID="lnkBtnEdit" Text="Edit" CommandName="Edit"></asp:LinkButton>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <p>
                                    <asp:LinkButton ID="lbtnUpdate" runat="server" CausesValidation="True" CommandName="Update"
                                        Text="Save" Width="25%" Font-Size="11px"></asp:LinkButton>
                                </p>
                                <p>
                                    <asp:LinkButton ID="lnkCancel" runat="server" CausesValidation="False" CommandName="Cancel"
                                        Text="Cancel" Width="25%" Font-Size="11px"></asp:LinkButton>
                                </p>
                            </EditItemTemplate>
                        </asp:TemplateField>
                    </columns>
                </asp:GridView>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell ID="TableCell1" runat="server">
                <asp:Table ID="Table20" runat="server" Width="100%" HorizontalAlign="Center" CssClass="chp-grid">
                    <asp:TableRow ID="TableRow20" runat="server">
                        <asp:TableCell ID="TableCell20" runat="server">Subject</asp:TableCell>
                        <asp:TableCell ID="TableCell21" runat="server" HorizontalAlign="Left">
                            <asp:TextBox runat="server" ID="txtSubject" Width="90%" CssClass="chp-text-field">
                            </asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtSubject"
                    Display="Dynamic" ErrorMessage="RequiredFieldValidator" ValidationGroup="MKE">* Subject is required!</asp:RequiredFieldValidator>
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow ID="TableRow2" runat="server">
                        <asp:TableCell ID="TableCell3" runat="server">Entry</asp:TableCell>
                        <asp:TableCell ID="TableCell4" runat="server" HorizontalAlign="Left">
                            <asp:TextBox runat="server" ID="txtEntry" Width="90%" CssClass="chp-text-field">
                            </asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtEntry"
                                Display="Dynamic" ErrorMessage="RequiredFieldValidator" ValidationGroup="MKE">* Entry is required!</asp:RequiredFieldValidator>
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow ID="TableRow3" runat="server">
                        <asp:TableCell ID="TableCell6" runat="server" HorizontalAlign="Left" ColumnSpan="2">
                            <asp:Button runat="server" ID="btnAdd" OnClick="OnBtnAddClicked" ValidationGroup="MKE" Text="Add" CssClass="chp-button-red"/>
                        </asp:TableCell>
                    </asp:TableRow>
                </asp:Table>
            </asp:TableCell>  
        </asp:TableRow>

    </asp:Table>
</asp:Content>